
package com.tools.cleanmaster.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTimeUtils {

    private static SimpleDateFormat sDateFormat = null;

    private static SimpleDateFormat getDateFormatInstance() {
        if (sDateFormat == null) {
            sDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        }
        return sDateFormat;
    }

    /**
     * Format time to stirng "yyyy-MM-dd"
     */
    public static String formatDate(long time) {
        return getDateFormatInstance().format(new Date(time));
    }

}
